package rdf_Encoder;



import gps_Convertor.Node;

import java.util.HashMap;

public class NodeStore {


	public static HashMap <Integer,Node> nodeList = new HashMap <Integer,Node>();
	static int nodeCount = 0;


	public static void storeByNodeFwd (int subjectId,int predicateId, int objectId)
	{

		Node node = null;

		//it is a new node that is not stored yet!
		if (!nodeList.containsKey(subjectId)) 
		{ 	
			node = new Node();
			node.setConnectionMap(predicateId,objectId,false);
			nodeList.put(subjectId, node);

		}else  
		{
			//it is an existing node
			node = nodeList.get(subjectId);

			if (node.getConnectionMap().containsKey(predicateId))
			{
				node.setConnectionMap(predicateId,objectId,true);
			}else {

				node.setConnectionMap(predicateId,objectId,false);
			}

		} // end of if
	} // end of storeByNodeFwd
} // end of NodeStore
